# creational pattern（创建型）
# -> singleton pattern（单例模式）
from abc import ABC, abstractmethod
##########################################
# 
class Singleton():
    def __new__(cls, *args, **kw):
        if not hasattr(cls, __instance):
            tmp = super(Singleton, cls)
            cls.__instance = tmp.__new__(cls, *args, **kw)
        return cls.__instance
    def __init__(self):
        print('my id is %',id(self))

singleton = Singleton()
# print(type(singleton))
# # print(singleton.__att)
# print(id(singleton))